<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:dailymarket="http://dailymarket.com/facelets"
	  xmlns:f="http://java.sun.com/jsf/core">
	<head><title>IGNORED</title></head>
	<body>
		<ui:composition template="../templates/layout.xhtml">
			<ui:define name="windowTitle">Daily Market | Partner | Deals</ui:define>
			<ui:define name="logoImage"><h:graphicImage library="images" name="logo_header.jpg" alt="logo" /></ui:define>
			<ui:define name="content">
				<div id="content" class="graphic_bg">
					<h:form>
						<div class="form-row header">Manage Deals
							<h:commandLink action="#{dealList.doNewDeal}" styleClass="image-button no-height" style="float: right;">
								<h:graphicImage library="images/icons/16" name="add.png" styleClass="with-text" alt="a" title="Add New Deal" />New Deal
							</h:commandLink>
						</div>
						<h:messages globalOnly="true" styleClass="form-messages" fatalClass="form-messages error" errorClass="form-messages error" warnClass="form-messages warn" infoClass="form-messages good" />
						<h:commandLink action="#{dealList.doShowInProgress}" styleClass="#{dealList.inProgressTabStyle}">In Progress</h:commandLink>
						<h:commandLink action="#{dealList.doShowNotStarted}" styleClass="#{dealList.notStartedTabStyle}">Not Started</h:commandLink>
						<h:commandLink action="#{dealList.doShowEnded}" styleClass="#{dealList.endedTabStyle}">Ended</h:commandLink>
						<h:commandLink action="#{dealList.doShowAll}" styleClass="#{dealList.allTabStyle}">All Deals</h:commandLink>
						<div style="display: block; border: solid 4px #FFFFFF; width: 920px;">
							<h:panelGroup rendered="#{dealList.renderDealTable}">
								<h:dataTable value="#{dealList.dealList}" var="theDeal" rows="20" id="dealTable" style="border-collapse: collapse;" rowClasses="odd-row, even-row" headerClass="header-row" columnClasses="id-col,data-col,data-col,tools-col deal-tools">
									<h:column><img src="#{theDeal.findDefaultImageUrl(100)}" alt="#{theDeal.shortDesc}" title="#{theDeal.shortDesc}" /></h:column>
									<h:column>
										<f:facet name="header">Deal Details</f:facet>
										<h:commandLink action="#{dealList.doManageDeal(theDeal)}" styleClass="table-link"><h:outputText style="font-weight: bold; font-size: 18px;" value="#{theDeal.shortDesc}" /></h:commandLink><br /><h:outputText style="font-size: 12px;" value="#{theDeal.longDesc}" />
									</h:column>
									<h:column>
										<f:facet name="header">Status</f:facet>
										<span class="#{theDeal.statusStyle}"><h:graphicImage library="images/icons/32" name="#{theDeal.statusImage}" alt="s" title="Status" style="vertical-align: middle;" /><h:outputText value="#{theDeal.statusMessage}" /></span>
									</h:column>
								</h:dataTable>
								<div class="page-nav">
									<dailymarket:paginator dataTableId="dealTable" showPages="10" selectedStyleClass="page-nav-link-sel" styleClass="page-nav-link" />
								</div>
							</h:panelGroup>
							<h:panelGroup rendered="#{not dealList.hasDeals}">
								<div class="notification error">There are no deals to display.</div>
							</h:panelGroup>
						</div>
					</h:form>
				</div>
			</ui:define>
		</ui:composition>
	</body>
</html>